package cn.ty.utils;

import java.io.Serializable;

import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.id.IdentifierGenerator;

/**
 * @author summit
 * @since 2021/8/2 10:39
 */
public class GenerateSnowflakeId implements IdentifierGenerator {
	@Override
	public Serializable generate(SharedSessionContractImplementor sharedSessionContractImplementor, Object o) throws HibernateException {
		return SnowflakeIdGenerator.getInstance().nextId();
	}
}
